﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DemoGraphics2D;

namespace QLNhaThuoc.Animation
{
    public partial class ucThuoc : UserControl
    {
        public ucThuoc()
        {
            InitializeComponent();
        }

        My2DSprite sprite;
        private void ucThuoc_Load(object sender, EventArgs e)
        {
            Bitmap[] bmp = new Bitmap[1];
            bmp[0] = Properties.Resources.smallPill02;
            sprite = new My2DSprite(bmp, 0, 0, bmp[0].Width, bmp[0].Height);
            sprite.state = 1;
            timer1.Enabled = true;
        }

        private void ucThuoc_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            sprite.Draw(g);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            sprite.Update();

            Invalidate();
            Refresh();
        }
    }
}
